package com.exampl.health.entity;

import java.util.Date;

/**
 * 用户实体类
 */
public class User {
    private Integer userId;        // 用户ID
    private String username;       // 用户名
    private String password;       // 密码
    private String email;          // 邮箱
    private String avatar;         // 头像路径
    private Date createTime;       // 创建时间

    // 无参构造方法
    public User() {
    }

    // 带参构造方法
    public User(String username, String password, String email) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.createTime = new Date();
    }

    // 带参构造方法（包含头像）
    public User(String username, String password, String email, String avatar) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.avatar = avatar;
        this.createTime = new Date();
    }

    // Getter和Setter方法
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", avatar='" + avatar + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}